import 'package:flutter/material.dart';

/// page跟widget各自继承此基类，并且带有各自的特性
/// */
abstract class BaseState<W extends StatefulWidget> extends State<W>
    with AutomaticKeepAliveClientMixin, TickerProviderStateMixin {
  /// 刷新页面state
  refreshState(VoidCallback fn) {
    if (!mounted) return;
    setState(fn);
  }

  bool isAutoKeepAlive = false;

  @override
  bool get wantKeepAlive => isAutoKeepAlive;
}
